package mac10.monitor;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JComponent;


public class ImageComponent extends JComponent 
{ 
  private static final long serialVersionUID = 8055865896136562197L; 
 
  private BufferedImage image; 
  private int imgWidth;
  private int imgHeight;
  
  public ImageComponent(int imgWidth, int imgHeight) {
	  super();
	  this.imgWidth = imgWidth;
	  this.imgHeight = imgHeight;
	  
  }
 
  public void setImage( BufferedImage image ) 
  { 
    this.image = image; 
  } 
 
  @Override 
  protected void paintComponent( Graphics g ) 
  { 
    if ( image != null ) 
      g.drawImage( image, 0, 0, imgWidth, imgHeight, this ); 
  } 
}
